-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: return correct test result status #575
Conversation
@@ -32,7 +32,7 @@ export const getStatus = (eventName: ValueOf<Testplane['events']>, events: Testp | |||
} else if (eventName === events.TEST_PENDING) { | |||
return TestStatus.SKIPPED; | |||
} else if (eventName === events.RETRY || eventName === events.TEST_FAIL) { | |||
return hasFailedImages(testResult.assertViewResults as ImageInfoFull[]) ? TestStatus.FAIL : TestStatus.ERROR; | |||
return isAssertViewError(testResult.err) ? TestStatus.FAIL : TestStatus.ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test result with errors could still has failed images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you check here only assert view error and don't check diff (isImageDiffError
) or no ref image (isNoRefImageError
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because testResult can only have assert view error.
isImageDiffError
and isNoRefImageError
- are image errors, and not the result ones. So if testResult has an image with isImageDiffError
or isNoRefImageError
- it would have AssertViewError
:
- https://github.com/gemini-testing/testplane/blob/406a2d4cc0bef646de18f2ce4eae2cd87ccb6e8a/src/browser/commands/assert-view/index.js#L60
- https://github.com/gemini-testing/testplane/blob/406a2d4cc0bef646de18f2ce4eae2cd87ccb6e8a/src/worker/runner/test-runner/index.js#L57-L58
I can, though, check for other errors, just in case
78c0ff9
to
4ee6fd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise /ok
@@ -32,7 +32,7 @@ export const getStatus = (eventName: ValueOf<Testplane['events']>, events: Testp | |||
} else if (eventName === events.TEST_PENDING) { | |||
return TestStatus.SKIPPED; | |||
} else if (eventName === events.RETRY || eventName === events.TEST_FAIL) { | |||
return hasFailedImages(testResult.assertViewResults as ImageInfoFull[]) ? TestStatus.FAIL : TestStatus.ERROR; | |||
return isAssertViewError(testResult.err) ? TestStatus.FAIL : TestStatus.ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you check here only assert view error and don't check diff (isImageDiffError
) or no ref image (isNoRefImageError
)?
4ee6fd5
to
8edc243
Compare
8edc243
to
5763ffb
Compare
Now (test has failed status, and no error message is shown, though there was an error):
After this PR (test has error status and error message is shown):